package com.miluGame.controller;

import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.miluGame.service.UserGroupService;

/**
 * 用户组
 * @author Administrator
 *
 */
@Controller
@RequestMapping("/user")
public class UserGroupController {
	
	
	@Autowired
	private UserGroupService userGroupService;
	
	private static int pageSize = 15;
	
	/**
	 * 查询所有的用户组相关信息
	 * @return
	 */
	@RequestMapping()
	
	public String queryUserGroup(HttpServletRequest rq,HttpServletResponse rsp){
		int pageNum = Integer.parseInt(rq.getParameter("pageNum")==null?"0":rq.getParameter("pageNum").toString());
		List<Map> userGroups = userGroupService.queryUserGroupByPage(pageNum, pageSize);
		rq.setAttribute("userGroups", userGroups);
		return "";
	}
	
}
